home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / Aliases.a < prev    next >
Encoding:
Text File  |  1996-05-01  |  5.7 KB  |  197 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Aliases.a
  3. ;
  4. ;    Contains:    Alias Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__ALIASES__') = 'UNDEFINED' THEN
  19. __ALIASES__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__APPLETALK__') = 'UNDEFINED' THEN
  25.     include 'AppleTalk.a'
  26.     ENDIF
  27.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  28.     include 'Files.a'
  29.     ENDIF
  30.     IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
  31.  
  32. rAliasType                        EQU        'alis'                ; Aliases are stored as resources of this type 
  33.                                                             ; define alias resolution action rules mask 
  34. kARMMountVol                    EQU        $00000001            ; mount the volume automatically 
  35. kARMNoUI                        EQU        $00000002            ; no user interface allowed during resolution 
  36. kARMMultVols                    EQU        $00000008            ; search on multiple volumes 
  37. kARMSearch                        EQU        $00000100            ; search quickly 
  38. kARMSearchMore                    EQU        $00000200            ; search further 
  39. kARMSearchRelFirst                EQU        $00000400            ; search target on a relative path first 
  40.                                                             ; define alias record information types 
  41. asiZoneName                        EQU        -3                    ; get zone name 
  42. asiServerName                    EQU        -2                    ; get server name 
  43. asiVolumeName                    EQU        -1                    ; get volume name 
  44. asiAliasName                    EQU        0                    ; get aliased file/folder/volume name 
  45. asiParentName                    EQU        1                    ; get parent folder name 
  46. ;  define the alias record that will be the blackbox for the caller 
  47. AliasRecord                RECORD 0
  48. userType                 ds.l    1                ; offset: $0 (0)        ;  appl stored type like creator type 
  49. aliasSize                 ds.w    1                ; offset: $4 (4)        ;  alias record size in bytes, for appl usage 
  50. sizeof                     EQU *                    ; size:   $6 (6)
  51.                         ENDR
  52. ; typedef struct AliasRecord *            AliasPtr
  53.  
  54. ; typedef AliasPtr *                    AliasHandle
  55.  
  56. ;  alias record information type 
  57. ; typedef short                         AliasInfoType
  58.  
  59. ;   create a new alias between fromFile-target and return alias record handle  
  60. ;
  61. ; pascal OSErr NewAlias(ConstFSSpecPtr fromFile, const FSSpec *target, AliasHandle *alias)
  62. ;
  63.     IF ¬ GENERATINGCFM THEN
  64.         Macro
  65.         _NewAlias
  66.             moveq               #2,D0
  67.             dc.w                $A823
  68.         EndM
  69.     ELSE
  70.         IMPORT_CFM_FUNCTION NewAlias
  71.     ENDIF
  72.  
  73. ;  create a minimal new alias for a target and return alias record handle 
  74. ;
  75. ; pascal OSErr NewAliasMinimal(const FSSpec *target, AliasHandle *alias)
  76. ;
  77.     IF ¬ GENERATINGCFM THEN
  78.         Macro
  79.         _NewAliasMinimal
  80.             moveq               #8,D0
  81.             dc.w                $A823
  82.         EndM
  83.     ELSE
  84.         IMPORT_CFM_FUNCTION NewAliasMinimal
  85.     ENDIF
  86.  
  87. ;  create a minimal new alias from a target fullpath (optional zone and server name) and return alias record handle  
  88. ;
  89. ; pascal OSErr NewAliasMinimalFromFullPath(short fullPathLength, const void *fullPath, ConstStr32Param zoneName, ConstStr31Param serverName, AliasHandle *alias)
  90. ;
  91.     IF ¬ GENERATINGCFM THEN
  92.         Macro
  93.         _NewAliasMinimalFromFullPath
  94.             moveq               #9,D0
  95.             dc.w                $A823
  96.         EndM
  97.     ELSE
  98.         IMPORT_CFM_FUNCTION NewAliasMinimalFromFullPath
  99.     ENDIF
  100.  
  101. ;  given an alias handle and fromFile, resolve the alias, update the alias record and return aliased filename and wasChanged flag. 
  102. ;
  103. ; pascal OSErr ResolveAlias(ConstFSSpecPtr fromFile, AliasHandle alias, FSSpec *target, Boolean *wasChanged)
  104. ;
  105.     IF ¬ GENERATINGCFM THEN
  106.         Macro
  107.         _ResolveAlias
  108.             moveq               #3,D0
  109.             dc.w                $A823
  110.         EndM
  111.     ELSE
  112.         IMPORT_CFM_FUNCTION ResolveAlias
  113.     ENDIF
  114.  
  115. ;  given an alias handle and an index specifying requested alias information type, return the information from alias record as a string. 
  116. ;
  117. ; pascal OSErr GetAliasInfo(AliasHandle alias, AliasInfoType index, Str63 theString)
  118. ;
  119.     IF ¬ GENERATINGCFM THEN
  120.         Macro
  121.         _GetAliasInfo
  122.             moveq               #7,D0
  123.             dc.w                $A823
  124.         EndM
  125.     ELSE
  126.         IMPORT_CFM_FUNCTION GetAliasInfo
  127.     ENDIF
  128.  
  129. ;
  130. ;  Given a file spec, return target file spec if input file spec is an alias.
  131. ;  It resolves the entire alias chain or one step of the chain.  It returns
  132. ;  info about whether the target is a folder or file; and whether the input
  133. ;  file spec was an alias or not. 
  134. ;
  135. ;
  136. ; pascal OSErr ResolveAliasFile(FSSpec *theSpec, Boolean resolveAliasChains, Boolean *targetIsFolder, Boolean *wasAliased)
  137. ;
  138.     IF ¬ GENERATINGCFM THEN
  139.         Macro
  140.         _ResolveAliasFile
  141.             moveq               #12,D0
  142.             dc.w                $A823
  143.         EndM
  144.     ELSE
  145.         IMPORT_CFM_FUNCTION ResolveAliasFile
  146.     ENDIF
  147.  
  148. ;
  149. ; pascal OSErr FollowFinderAlias(ConstFSSpecPtr fromFile, AliasHandle alias, Boolean logon, FSSpec *target, Boolean *wasChanged)
  150. ;
  151.     IF ¬ GENERATINGCFM THEN
  152.         Macro
  153.         _FollowFinderAlias
  154.             moveq               #15,D0
  155.             dc.w                $A823
  156.         EndM
  157.     ELSE
  158.         IMPORT_CFM_FUNCTION FollowFinderAlias
  159.     ENDIF
  160.  
  161. ;
  162. ;   Low Level Routines 
  163. ;
  164. ;  given a fromFile-target pair and an alias handle, update the lias record pointed to by alias handle to represent target as the new alias. 
  165. ;
  166. ; pascal OSErr UpdateAlias(ConstFSSpecPtr fromFile, const FSSpec *target, AliasHandle alias, Boolean *wasChanged)
  167. ;
  168.     IF ¬ GENERATINGCFM THEN
  169.         Macro
  170.         _UpdateAlias
  171.             moveq               #6,D0
  172.             dc.w                $A823
  173.         EndM
  174.     ELSE
  175.         IMPORT_CFM_FUNCTION UpdateAlias
  176.     ENDIF
  177.  
  178.     ENDIF
  179.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  180. ;   Given an alias handle and fromFile, match the alias and return aliased filename(s) and needsUpdate flag 
  181. ;
  182. ; pascal OSErr MatchAlias(ConstFSSpecPtr fromFile, unsigned long rulesMask, AliasHandle alias, short *aliasCount, FSSpecArrayPtr aliasList, Boolean *needsUpdate, AliasFilterUPP aliasFilter, void *yourDataPtr)
  183. ;
  184.     IF ¬ GENERATINGCFM THEN
  185.         Macro
  186.         _MatchAlias
  187.             moveq               #5,D0
  188.             dc.w                $A823
  189.         EndM
  190.     ELSE
  191.         IMPORT_CFM_FUNCTION MatchAlias
  192.     ENDIF
  193.  
  194.     ENDIF
  195.     ENDIF ; __ALIASES__ 
  196.  
  197.